package ferp.android.widgets.buttons.rank;

import android.content.Context;
import android.util.AttributeSet;
import ferp.android.R;
import ferp.core.game.Bid;
import ferp.core.game.Game;

/**
 * User: igorgok
 * Date: 12/30/13 12:25 PM
 */
public class RankButtonUp extends RankButton
{
  public RankButtonUp(Context context) {super(context);}
  public RankButtonUp(Context context, AttributeSet attrs) {super(context, attrs);}
  public RankButtonUp(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);}

  @Override
  protected boolean getEnabledState(Game g, Bid bid)
  {
    return bid.tricks < Bid.MAX.tricks;
  }

  @Override
  protected String getText(Bid bid)
  {
    return isEnabled() ? String.valueOf(bid.tricks + 1) : "";
  }

  @Override
  protected int getButtonBackgroundResource() {return R.drawable.selector_button_rank_up;}
}
